fix token input bug in which first letters deleted

/cc @sshillo @mgamba @MJefferson