Fix templates compilation