Window handle may be null when creating a device.
Do the occasional keypress cleanup.
Small fix to key cleanup code and test version number.