Changed LatexGraphics to SingleTon pattern

And fixed consecutive errors