Fix bug in determining mean difference