Fixing serialization and setting up tests.