Fixed bug in polygon rendering