Close fie before deleting to prevent multiple prompts on edited files
Fix for key exception on 32 bit Windows system