Sheetmetal flatten incorrect

 

Why won't solidworks properly flatten this part. The flanges will be the only thing in the flatten state