Fixed bugs in AreKeysLeft and GetKey.