Redundant strlen
Fixed indexing bug on input cursor movement