os.environ test clean-up and reorder overwrite

fixes issue 197