Fixes to ical function