Improve PID checks