Changed functions so that the file separator character (\ or /) is retrieved depending on the platform, so it works on both Win and UNIX (Linux, MAC)