Compat with Python 2.7
Minor refactor
Styling
Stricter check with backspace
Reset on real backspace