Fixed passing local and extended vars down.