Fix date range bug