Fixed NPE on setDateRange