Some serialization fixes