Improved error messages for AttributeErrors, however not a final version #408