Fixed bug with wrong duration check.