Improve unflatten test