backport fixes from calendar repo