Glad to hear you sorted it out.
In general compositing separate matte-objects involves unpremultiply node before merge node and premultiply node after it.
Unpremultiply will of course make the edges jagged but it will ensure correct merge-process and then premultiply node will fix the edges.