Added code to preserve environment variables during script sudo calls.