Fix stop overflow in std. for non-square matrices.

Prevents the starting row/col to calculate the standard deviation for
from being greater than the array shape.