Fixed problem with reshape/flatten for 1xn arrays