Fix problem when running the script from ~/.script