Fix depreciation warnings on templates