Fixed a bug in CntUniqBiDirEdges
Added comments and fixed small bugs in Cnt... functions in alg.h