Fix NaN showing up when inserting a new event or activity from calendar.