Add dimensionality check to initialization stage