Corrected calculation of ad position.