Modifed directory count routine
Minor changes