Added generic constraint to extension methods.