Fixed several errors in example code.