Fixed incorrect exception return