Fixed leaks in hotkey thanks to better understanding of Lua/C.