flatten-fix