Additional bug fixes.

- variable gDataFileSelected added (set to 1 if a data file is
selected).
- fixed a root user issue/now using gID (like in my other scripts).
- variable DEBUG renamed to gDebug (like in my other scripts).