             (dateGrid.selRangeMode == 1 || dateGrid.selRangeMode == 3))
         {
         	var newDate:Object = CalendarLayout.getNewIncrementDate(displayedYear, displayedMonth, 0, 1);
-            var testDate:Date = new Date(newDate.year, newDate.month,
+			
+			if (selectableRange.rangeEnd != null)
+           		var testDate:Date = new Date(newDate.year, newDate.month,
                                          selectableRange.rangeEnd.getDate());
 
-            if (selectableRange.rangeEnd >= testDate)
+            if (selectableRange.rangeEnd == null || selectableRange.rangeEnd >= testDate)
             {
                 dateGrid.stepDate(0, 1, event);
                 invalidateDisplayList();

            (dateGrid.selRangeMode == 1 || dateGrid.selRangeMode == 2))
        {
        	var newDate:Object = CalendarLayout.getNewIncrementDate(displayedYear, displayedMonth, -1, 0);
            var testDate:Date = new Date(newDate.year, newDate.month,
                                         selectableRange.rangeStart.getDate());

            if (selectableRange.rangeStart <= testDate)
            {
                dateGrid.stepDate(-1, 0, event);
                invalidateDisplayList();

            (dateGrid.selRangeMode == 1 || dateGrid.selRangeMode == 3))
        {
        	var newDate:Object = CalendarLayout.getNewIncrementDate(displayedYear, displayedMonth, 1, 0);
			
			if (selectableRange.rangeEnd != null)
           		var testDate:Date = new Date(newDate.year, newDate.month,
                                         selectableRange.rangeEnd.getDate());

            if (selectableRange.rangeEnd == null || selectableRange.rangeEnd >= testDate)
            {
                dateGrid.stepDate(1, 0, event);
                invalidateDisplayList();
