Every 2nd index gets skipped

I just realised that the blank/0 entry happens only when the user presses the Enter key after each entry. If the user just clicks outside the editable text box after each entry, the entries get added into the arrays correctly/as I intend them to. So I think it’s something to do with my On Text committed scripting.