Fix writeout directory