Fixed a bug with key binding code.