Help with a Global Save script

Hello! I have a couple of problems with theLEECH global save script for VX Ace.

You can find the script here, and the two issues (just one, to be precise. The other 'issue' is just a thing of mine) I would like some help with are:

1) When in the load menu, you can try to load an empty savefile, crashing the program. Now, this is not a big deal, but it still bugs me out.
I tested with a empty project to see if it was some incompatibility problem, but the error still exists.

2) I would like to move the directory in which where the Global save file is located. In the script you can only change the name, I would like to change the directory as well (To be precise, Data/Savegame. Is the directory I use in my game to store the savegame, since i don't like them lying around in the main folder).

Can someone more expert than me help me to figure out how to deal with those two problems?
Necro Posting, I know. Sorry
1) When in the load menu, you can try to load an empty savefile, crashing the program. Now, this is not a big deal, but it still bugs me out.
I tested with a empty project to see if it was some incompatibility problem, but the error still exists.
I can't reproduce this problem. A new project with no other script except the global save works fine.
The default is no not load a save game if there is no save game for that slot. So you MUST have something that is overwriting this.

2. modded script to add folder save and creation if does not exist. Tested and works fine
Spoiler: TheLeech - Global Save 1.0c
Ruby:
#==============================================================================
# # Global Save System [v1.0c]
# # By theLEECH
# # Fixed by TheoAllen
# # Addon by Roninator2
#==============================================================================
# ---INSTRUCTIONS---
# Put the numbers of the variables to save and the switches to save in the
# VARIABLES_TO_SAVE array, and the SWITCHES_TO_SAVE array.
# If you want to automatically load/update the globally saved data, set the
# SAVE_ON_SAVE LOAD_ON_LOAD and LOAD_ON_NEW flags to true accordingly.
#------------------------------------------------------------------------------
# You can load and save global data within an event, by using the script command
# and entering: "global_save" or "global_load" (Without qoutations)
#==============================================================================
#==============================================================================
# # LGlobalSave
#==============================================================================
module LGlobalSave

#==============================================================================
# CONFIGURATION
#==============================================================================
# Whether or not the variables and switches in the global file should be
# saved when the player saves the game
  SAVE_ON_SAVE = true
# Whether or not the variables and switches in the global file should be
# loaded when the player loads a save file
  LOAD_ON_LOAD = true
# Whether or not the variables and switches in the global file should be
# loaded when the player starts a new game
  LOAD_ON_NEW = true
# An array that contains a list of variables to save in the global save file
# Enter a list of variables, by number, seperated by commas.
# You can use '..' to include all variables between two numbers
# Example: 15..42
# Will include all variables or switches between 15 and 42 (inclusive)
# Leave blank to save none of that type
  VARIABLES_TO_SAVE = [1]
# Same as above, but for switches
  SWITCHES_TO_SAVE = [1,13]
# The name of the file to save global variables and switches in
  FILE_NAME = "Global.rvdata2"
# The name of the folder to save global file in
  FOLDER_NAME = "SaveData"
#==============================================================================
# END OF CONFIGURATION
#==============================================================================

  def self.saveTheFile(f)
    Dir.mkdir(FOLDER_NAME) if !File.exists?("#{FOLDER_NAME}/#{FILE_NAME}")
    File.open("#{FOLDER_NAME}/#{FILE_NAME}", "wb") do |file|
      Marshal.dump(f, file)
    end
  end

  def self.loadTheFile
    if !File.exists?("#{FOLDER_NAME}/#{FILE_NAME}")
      f = makeNewFile
      return f
    else
      f = nil
      File.open("#{FOLDER_NAME}/#{FILE_NAME}", "rb") do |file|
        f = Marshal.load(file)
      end
      return f
    end
  end

  def self.makeNewFile
    return LGlobalSaveFile.new
  end

  def self.loadVariables(f)
    for i in VARIABLES_TO_SAVE
      $game_variables[i]= f.getVar(i)
    end
  end

  def self.loadSwitches(f)
    for i in SWITCHES_TO_SAVE
      $game_switches[i]= f.getSwitch(i)
    end
  end

  def self.saveVariables(f)
    for i in VARIABLES_TO_SAVE
      f.setVar(i, $game_variables[i])
    end
  end

  def self.saveSwitches(f)
    for i in SWITCHES_TO_SAVE
      f.setSwitch(i, $game_switches[i])
    end
  end

  def self.save
    f = makeNewFile
    saveVariables(f)
    saveSwitches(f)
    saveTheFile(f)
  end

  def self.load
    f = loadTheFile
    loadVariables(f)
    loadSwitches(f)
  end

end # end of module LGlobalSave

#==============================================================================
# ** LGlobalSaveFile
#------------------------------------------------------------------------------
# An object of this class is saved in the global.sav file
# It contains all the saved variables and switches
#==============================================================================
class LGlobalSaveFile

  def initialize # Initializes the object
    @var = []
    @switch = [1]
  end

# @var holds the saved variables
# set and get methods:
  def getVar(id)
    return @var[id]
  end
 
  def setVar(id, val)
    @var[id] = val
  end

# @switch holds the saved switches
# set and get methods:
  def getSwitch(id)
    return @switch[id]
  end
 
  def setSwitch(id, val)
    @switch[id] = val
  end

end # end of class LGlobalSaveFile

#==============================================================================
# These methods are for saving and loading the global save file from an event
#==============================================================================
def global_save
  LGlobalSave.save
end
def global_load
  LGlobalSave.load
end
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager
  class << self
    alias glob_new_game setup_new_game
  end
  def self.setup_new_game
    glob_new_game
    LGlobalSave.load if LGlobalSave::LOAD_ON_NEW
  end
end # end of module DataManager

class Scene_Save
  alias glob_save_succ on_save_success
  def on_save_success
    LGlobalSave.save if LGlobalSave::SAVE_ON_SAVE
    glob_save_succ
  end
end

class Scene_Load
  alias glob_load_succ on_load_success
  def on_load_success
    LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
    glob_load_succ
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-global-save-script.120806/