Fix adding to PATH

Test if the PATH variable exists before manipulating it.