off-by-1, fixes #191