Fixed bug in SpriteLayer Optimalisation