clone fixed for SGMatrix type parameters

fixes issue #1821