Fix logic for removing unversioned files