added missing 'raise' for AttributeErrors
merged with origin/master