Changed and fixed cov2corr

I changed and fixed the `cov2corr` function, which gave wrong results. I added a test and simple docs.