Whoops, off by 1; passed some more tests, but now item with key 0 was lost.