Fixed some issues with chunk serialization