Clean up the examples to use the new API. 

I've fixed this.