fixing more bugs in new data structure serialization