Check for undefined attributes. Closes #3487.