Duration fix + tests