Fixed bugs in directory