Support multiplex/overlay modes

This fixes #5460.