Bug fix: offset calculation when using flat files was completely broken.