Changed window.removeIndicatorById assignment to standalone function declaration before assigning to window, allowing it to be properly exported. Added extra debug logging to track which indicator type is being added to help diagnose duplicate additions.