Fix templates issues