Fix bug in #assign_attributes