Fix bugs in readme example code