.count() improvement and prototype fix