Intermediate fix for buttons with wrong status in addLayer.