Fix a newly introduced bug in drawSegments()