fixes for missing directories, wrong permissions