Fixed off-by-1 because of lat index vs count confusion.