Pass back correct exit code