Added unit test to TextureManager, fixed bad access in release loop