Bugfixes in serialization code; Cosmetic code changes.