Fixed the template plugin, wasn't even compiling.
Some improvements to the cython test.
Bugs found by the cython test.