Better fix to the rendering bugs.