Fix size calculation of parent container