Fixed `setTimeout` and `setTrigger` not working correctly when adding dates in the past or infinite delays.