Fix templates for 3.x compatibility