Fixed some bugs related to the render order and layer index.