Corrected removeAll implementation