fix null bytes being stripped from the middle chunks, since we know the chunk size