Clean up of some IO related things.