Added support for EmptyMat.