Fix chdir with implicit extension