Fixed bugs in DateTimeRange. Wrote tests.