For #51: fix crash for setCalendarDate and better handling of start day of week