Fixes for -pedantic.
Proper support for purgin removed directories.