Fixed cleanDirectory