With the `np.max(np.shape(x))`, this is properly handle, but not with `np.shape(x)[0]`.

``` ipython
In [3]: np.shape(np.array([[1, 2, 3, 4]]))[0]
Out[3]: 1

In [4]: np.max(np.shape(np.array([[1, 2, 3, 4]])))
Out[4]: 4

In [5]: np.shape(np.array([[0, 1, 2]]))[0]
Out[5]: 1

In [6]: np.max(np.shape(np.array([[0, 1, 2]])))
Out[6]: 3
```