Fixes for RT #123405 and RT #123406

I issue this as a PR with the idea in mind that I might be messing up a fix made for an earlier reason; spec tests pass, though!