Fixed class encoding + test.