Fix missing tiles on layertree update

Fixed layertree update potentially causing missing tiles.