Fix examples to work in new API
Merge branch 'fix-examples'