I corrected several segmentation fault in remove function