Block binding: Handle nested scopes better

#1358