fixed some generics for GMat