small fixes in global error handling