Remove trailing whitespace and disable cursor keys