Improved support for Java 7 templates