Add handler to produce a proper backtrace on error