Directory cleanups and fix test