Give some more love to #1253.

Issue #1253 was fixed within microseconds (wow!) while I had already started working on this pull request.  I've re-based it to include the previous fix and add some more loving robustness.