More error checking.
More fixes.