Fixed deadlock on exception being thrown.