Fix wrong index for dimensions.