fix errors in remove.py