Fix for exitCode not working for unit tests