Make example serialization code use correct library functions