Fix bugs in RenderPipeline