Fixed animation lenth calculation.