Cleanup of general file-handling.