issue #22155: Add error checking.
issue #22155: More error trapping.