If no environment is loaded, just exit.
Use absolute path name for _THIS_DIR.
Use abspath when comparing paths.