Fixed a 2.6 compatibility issue regarding timedelta's total_seconds()