adaptComposition: fix calculation of reference offsets