Modify several functions to adapt to the document v4.0.