Improve previousVisiblePosition()