Fix bug in expand variable fix.