Fixed up render-to-texture code.