fixed some of the wrongly changed ndims back