fixes to make it work with new serialization format