Moved the cursor rendering to the end of render_layer3().