Tests for template and tplarg.
Another bug fixed