Error-Fix in flatten