Fixed bug in correlation simulation functions.