Fixed exit on exception bug