Fix env provider restoring