Updated catcorr function.