Fix directory stack