Fix off-by-one, add docs