Port offsetof "fix" from swarm sdk.