Fix dirname with spaces bug

- we lose spaces in directory names on recieving a pushd