Initialise context before using it. (cherry picked from commit a4947e4e064d2d5bb622ac64cf13edc4a46ed196)