Fixed scope issues, include issues and removed Texture destructor