Added mean calculation support for complex types.