Fix cd bug in script.