Adding numpy count_nonzero & minor template fix

Have i missed something?
You couldn't see the difference between w/ and w/o bool specialization?

The static cast is needed for the complex case.
That was the point, not some failed opti.