Var bugs

two dead variables plus a scoping issue