In the og_abt_flatten_groups() function, there are two places where it does an array_merge, instead of a straight concatenation. This has the effect of reindexing the array keys since the arrays have numeric keys. This is an issue because OG can normalize $node->og_groups by only using the array keys and ignoring the values. This will result in the post potentially being added to the wrong groups.

This:
$nids = array_merge($nids, $found);
Should be this:
$nids = $nids + $found;

and...

This:
$nids = array_merge($node->og_groups, $nids);
Should be this:
$nids = $node->og_groups + $nids;