Tidy up file i/o.

Remove workaround.