Fix logic in safeclean