Changed checking if a file exists to use Stat rather than Open with a no-variable return