Fixed counting problems solved on preprocessing