Fixing test_keys()