Revert "Revert "more fixes to renderer""

This reverts commit bd2ff3bbe062c5cfe1ed88f2a9263b4fcac02da1.