some minor fixes for exceptions