Fixes error on opening directory and optimizing

Output no longer on mutexes