fix class assignment bug (closes #1)