Fixed crash on 64-bit platforms
Improved reliability of keyboard hook (a tiny bit)
Silenced another type conversion warning