Fixes to countdown code, removed bug when no main date set