Improved parse_timedelta
Fix all errors found using unit testing.