Fixed a bug in BamsDirCount