Fix doc build and offline build