Bugfix for count() method