That looks like it should do what you want to me. When I try it it looks like it does the right thing. Is it working for you? You can verify pretty easily by plotting cov and new_cov to see if the corner has changed.
K = cov(x).eval(); plt.imshow(K);