Fix directory-changing logic