Fixed Karma crash when unit test crashes