Fix #2227, which was coded incorrectly, to be simpler/safer.
2 files changed