Avoid using count() if not really needed

Count is an expensive operation. See http://maettig.com/code/php/php-performance-benchmarks.php.
Wondered for a second how this could have gotten in. Then I remembered - that commit had a -2 and someone merged it anyway.