Tested and partially repaired debouncing

Testing in the emulated keyboard logs some wrong keys. To be tested in
lab.