Fixes to calendar functionality