Make "undefined attribute" error message more informative