Update some docstrings which had got out of date

The examples were updated by trial and error, so there may be better ways to do the same things.