Adding numpy count_nonzero & minor template fix

Have i missed something?
add a test where you compute ``count_non_zero(a*2)`` and you'll see where the problem lies!