Fix update_doc bug and build doc files