minor enhancement of matrix insert