Some fixes to get the viewports working a little bit better