Good find.  I've fixed this and the tests are now such that they would have caught this bug.