Added more compatibility to 2.7 templates (#575)