Set correct mode for dir nodes