Rewrite part of snapshot feature to get connections correctly

I've tried to minimize the amount of code I'm touching to complete this. I'd prefer not to rewrite the entire class.
You shouldn't ever be able to deploy code that would result in this kind of thing failing, unless you are explicitly malicious. But yes, we already had this issue in terms of "What if the environment file has a syntax error" :P