Fix #1662 "Error when referring to nested bind with a variable"