Clarify container exit logic

Condensed three variables into one variable with three states.  Clarified logic handling these states.