Fix the calculation of Quad and Cuve primitives

Changed the calculation of the Quad Elements in a Cube