Changed PyArray_SHAPE to PyArray_DIMS.