Corrected scope issues so that API remains unchanged