Added tests for stopOnException.