Correct documentation example and add a corresponding test.