sdag: Eliminate dead variables and weird logic that led to warnings