Fixed bug in PID removal