Corrected mistakes to make script independent of path it is executed from.