Fixed numerous bugs related to changing directory structure.