bug fixes for rendering.