Fixed path handling to always get script's path