fix CalculateTD so shorter forks don't take over