Created by: tsenart
On second thought this optimization doesn't seem worth it, and the current code is safer.
Existing tests.