What type of play was in progress at the time of the foul? Did anything (loose ball) happen after that would change the type of play (loose ball behind neutral zone).
In your last example the ball was in player possession - a running play was in progress. That didn't change for the rest of the down. Therefore, the basic spot is the end of the run.