Fixed bug in bad pid check.