Use "has_key?" instead of "key?"
Add test for invalid nested default