Fix crappy writing