I *think* the code is right an the tests are wrong, but I'm too unwell/tired to verify that just now.