Fixed bound checking for LayerRender