fixes for generic type instantiations