Fixing check on time range.