Changing multidim implementation to use multi-scalar where possible.