Fix flags for invalid LayerTreeModel index

.. bug reported by ModelTester