merge template-compilation branch into master