fixed tiled map parser's problem where the layer index might be wrong.