Template quirks

Fixes VC12 compilation. Thanks to Cheng Li 
The modification in the example use the specialization of the number generators, this should make compilers to have more difficulties now. The sooner they yell the better. These are ok on gcc and VC9.