Merge "Improve starting offset calculation"