PID Code bugs

If you read the PID tutorial main post, it explains what to do in those type of cases: