Fix the duration behavior.

Otherwise it breaks on my machine and never stops.