OK, after reading completely and slowly the full code of the function, my conclusions are:

- The typo you put in matters. The code is indeed currently wrong, which tells me that our test suite is incomplete
- I still believe that the 2 successive if statements should be merged, because there is no point computing the bounds twice when the shape is 3 x 3.