Improved the display of PID.
Added a check of the size of the rectangle to be drawn.