Some fixes for rendering