Fix memory leak with custom importer not being freed