misc fixes
fix up directory handling