some bugfixes for new serialization