Fix version calculation.