Fixed code so that the unit tests work again. Also added keyboard tests.