Fix the same bug returning wrong count value.