Oops, meant to use $failed (number of failed checks) as the exit code.