harden error handling, refs #1299