fix off-by-one in tests too; add test for full range