Fixes #94: use raise_error to fail test and get stack trace and print a more helpful message. Plus add regression test