Optimize error message about missing attributes