Improvement to "pointerInBounds".