Fix multiple generations of function for offset calculation of virtual b...

...ase.