Fixing error that happened when saving as from plugin with a bad extension