doc improvements, example code fixes