Fix and test Dimension math.