Fix the pointer index

It has to point to the end of the current block, not to the
beginning of the next block. See L581.
Merge pull request #1833 from ahocevar/hit-detection-pointer

Fix the pointer index