Update cast type used to convert Templates to file