Improve testing directory condition.