Fixed bug that caused index out of bound errors in calls to gl.drawElements.