Fixed directory checking