Fix hotkey bug and compile error on Mac