I prefer exporting frames in Multilayer EXR with turned off Compositor to save some RAM. When scene involves disabling render layers, Multi EXR just throws them out.
Here you can see, that layer "2" is unchecked on second frame, and Image node provides next available layer, which is Combined.
This behaviour forces me to add Switch nodes drived in according with renderlayers to replace incorrect layers with empty value.
What can I do to make it work without additional steps?