Work around a bug in zend frameworks countParts() function