Improved stream-to-timespan conversion.