Fix bugs in MGCalendar