Fix bugs in TimeDelta and extend test suite.