Use a success predicate instead of success codes

Interestingly this does not break the tests.