Fix calendar bugs