Fixing directory bugs