completion: More fixes to prevent unbound variable errors