Misc fixes to generics