Fix bug in parseDuration method