fix previous regression test to actually expose the bug, and fix it