Actually improved detection of script location