Fix a bug in remove checks