Image changes after rendering: masking render layers

Hello.

The first image is basically what I want. I first tried rendering the layer alone but it doesn’t look right without alpha.

See the tab under render window saying “depth”? When the rendering stops (in any way) and that tab changes to combined the scene is somehow inverted (see below): I end up with a black picture and the tree (without leaves) is the only thing that remains in the scene. I fiddled with some settings I thought could work but they only have an effect on the rendering, unfinished image. Even turning off use nodes didn’t work.

The scene is on layer 1 in cycles. The layer depicted is of smoke in blender Internal on layer 2. There are a few copies of objects on layers 5 and 6, which could be what is visible in the bottom pic though if so not all are showing.
I found this technique on the forums though it’s been causing me nothing short of grief so far. I need to know why the rendered layer is okay one moment, then warped the next?