(x_build_heuristic_mask): Fix a bug not incrementing