Fix API in example code.
Fix code style.