fix inheritance templates