Issues #175, 148: reworked 'cd' parsing