This corrects b3c908b4 by allowing a NULL value again for variable deletion. Fixes: #6753 (cherry picked from commit e1e26566)