Fixing bugs in remove scripts.