Handles cleaning up of temp files.