Fix bugs in Calendar