Fix expiring for the last time, and fix legacy importer