Fix class names not being correctly set/read.
Add tests for #37.