BUG: optimize: fix botched test for scalars

Any row-vector or other ndarray with shape[0] == 0 was passed through.
`assert_in` fails because one of the Travis workers has too old a Nose version. But I'll try your other suggestion.