Fix test for flatten method