Improve error messages for missing keys