Fail on failed tests

Fixes #657