General improvements to PID