Added ability to limit count to specific types