Fix some bugs related to keyboard bindings