more fixes for exception handling