Fixed divide by zero error in slope method.