Fix texture removal code