Fixing file output