Fix ReverseIndex bug.
Move cursor to origin when setting scroll margins.