Fix writing zeroes