Added ability to optimize an entire directory
Adjusted exception raising logic