Fix assert_nD call in template.py
Fix canny test to reflect new error type.