We call Ollie to us and treat him when we anticipate any issues like this, either that or change direction or throw a ball to distract him. You get a feel for spotting people who won't like dogs running up to them. If giving him a treat you can spin out the time until the person has passed by getting him to do commands, sit, lie down, paw etc before gving the treat It's difficult for them because they get such inconsistent messages about jumping up - some people in the park will pet and fuss him when he does this which makes him think it's ok. I always tell him sternly to get down even if the other person is encouraging him.
With walking to heel we've had some joy holding a treat in the other hand from the lead hand and keeping that about thigh level - Ollie is very food oriented so he focuses on that, we couple that with saying 'heel' and 'good boy' and reward him with the treat when he manages a good distance with the lead slack. We also stop altogether if he is pulling too hard before continuing and reminding him to heel, and we have also stopped and walked back in the opposite direction (can be slow progress, 10 steps forward, 2 steps back, lol). He pulls usually because he knows where we are going and is impatient to get there - stopping, or turning back slows this down and lets him know pulling on the lead is not going to help in getting anywhere more quickly!
We practice walking to heel in unfamiliar places where he is less confident about where he is going and less likely to pull hard in the first place, that way his focus is more on us.