Keyboard bug fixes

This will close #151 and #154