Cleanup and fileupload stuff