Fixed a typo in shapes.d

Causing a range error, as `j` gets up to 3.