I thought already about layers added without passing through gaLayers, which was premature (we don't have this case yet). I'll correct.

(Note that this is part of #375.)