Passing TextureManager through MapEditor. Fixed bugs.