Minor changes to functions in calendar.js