Transparent objects create x-ray vision

I rendered a scene with transparency, and wherever there was a transparent object in front of an opaque object, the background object became transparent as well in the alpha map. Is there a fix for this?