Fixed some errors in example code