Minor documentation fix and reordering of a bit of code in the context module