fixed forgotten debug code
added more tests for templates