MatMex contour correction