mm directory $var/cd fixes

tree: 1c75a30, parent commit: 63622b5