Improved connected textures code, which works as meant to.