Fix x-correlation normalization issue. Eliminate memory leaks. Fix plots.