Fix shell.cd and add tests