Test handling of templates with invalid template target