[polyml] Changes to Foreign structure