Fix stream includes throwing errors during global state preservation

Related to issue #1308.

I wasn't sure exactly where to write tests for this. Any guidance would be appreciated!
I thought the same but found it hard to unit test since I'm not sure of a way to mock static protected methods.