Fix deprecated (in 3.4) use of variable in template