Fix writing