Fix example code bugs, clarify comments.