Fixed kryo serialization bug and test cases