fix generics compilation errors