Fixes #928
minor fixes to serialization and tests
Merge pull request #929 from brycethomas/issue928

Fixes #928