Additional protections for #557.

This is in conjunction with the pull request for #415