CMStats: fix up the logic and potential sync failures