Fixed bug, creating dir tree instead of tree in write rank files to dir.