some fixes for exceptions