Fix enter and backspace bugs