More error handling fixes.