Layout and rendering fixes