Added template disposal.