Bugfix on directory removal