it's a bit inelegant I agree but this case happens due to the array2d when y.ndim == 1 as input. The code next now only works with 2d y. Makes sense?