path: Fix off-by-one in indexing