Fix bad exceptions caught