Fix generic type warnings