Fixed bug in serializing checkpoints (issue #47)