Handling empty arrays in correlation calculation.