Fixed bugs with calendar