Fixed type and date comparison in script that imports events.