Added offset calculation when allowWrap = false