Added check for number of rows of G and information in dims to MEX interface