Fix smarty link function