Exception handling fixes.