Fix possible divide by zero error on data processing.