Fixed various minor bugs with dimensionality