more bug fixes in the exception handling