some fixes to the deserialization