Fix change directory bug introduced in prev commit