Fix serialization in the presence of compression/renaming

@bergmark FYI