Let check return nonzero exit status on failure

This is a fix for #198.