Fix the layer visibility

When we click on the last layer group the layer still be visible with
the layers ...

Fix #632