Problem: Do "the key" and "it" point to the same thing in the following sentence?

I was trying to open the lock with the key , but someone had filled the keyhole with chewing gum, and I couldn't get *it* out.
****
A: no

Problem: Do "Tom" and "he" point to the same thing in the following sentence?

Tom threw his schoolbag down to Ray after *he* reached the bottom of the stairs.
****
A: no

Problem: Do "pony" and "him" point to the same thing in the following sentence?

The boy continued to whip the pony , and eventually the pony threw him over. John laughed out quite loud. "Good for *him* ," he said.
****
A: yes

Problem: Do "the master" and "he" point to the same thing in the following sentence?

After I saw Bill catching flies and pulling off their wings, I boxed his ears. I showed the master the flies, some crushed and some crawling about helpless, and I showed him the wings on the window sill. I never saw him so angry before; but as Bill was still howling and whining, like the coward that *he* was, he did not give him any more punishment of that kind, but set him up on a stool for the rest of the afternoon, and said that he should not go out to play for that week.
****
A:
no