Add some basic tests for templates; adjust error messages again.