Fixing template type check
Adding numpy count_nonzero
Merge pull request #271 from artas360/master

Adding numpy count_nonzero & minor template fix