Changed remove file to only remove files that exist.