Fix global exception handler