Refactorings for new directory path.
More base directory changes and a bugfix.