fixed minor bug in ensure2D