Fixed some bugs in the G2M count service