Some key checking cleanup.