Fix compile errors in example

Fix compile errors so that the example compiles with the latest nightly.