Fixing bug with RegisterHotkey routine

* Cleanup