Fix condition when testing exit codes