Merge changes I021be9a3,Ia11839d1

* changes:
  LayerTraceGenerator: Fix layer deletion
  LayerTraceGenerator: Fix duplicate layer ids