Fixed some errors in remove