Fixed issues with rendering viewports.