Adding numpy count_nonzero & minor template fix

Have i missed something?
I still find this far less readable than
```
if(*begin)
  ++count;
```