Added template cleanup.