Return correct exit code for tests