Environment checking fix.

Was causing numerous error calls.  Ended up crashing a server.  This Seems to have fixed it.