Improved working directory behaviour to allow toggling