MergedRgbVirtualStack: add tests and fix bugs