added some checks over key and key_schema objects