Layer usage fixes. (cannot create same ID layers).

Arranging layers by their ID.