fixed serializor, add a simple test (todo: more tests)