Fix dangling texture bug.