Cleanup file handling