Generator/GEMM : Fixed invalidity checking