Fix imports; fix keyscan_check()