BUG: Fixes #5376: np.ravel to return same array type

See commit message for details.
Hmm, does this need to be a 1-d array?