Fix dmean bug