Added slightly more elegant handling of setting the oref environment variable