Fix for test flatMap/toSeq