harden error handling, refs #1205