Various improvements to viewport hierarchy