Fixed embarrassing bug in directory logic.