Fixes #951. Test case added to exercise new error reporting. Also added extra test for when Template is missing. Closes #961