Merged in interleaved-queries branch