Added a fix for when the script isn't run via a symlink.