Stricter type checking for ndarray conversion

Fixes #276

As a side effect, correct a mis declaration in a test ;-)