Unittest - Fix case where exit code was incorrectly registered