Raising a useful error and adding a speccific tests

Fixes #506