Fix bugs exposed by examples
Merge branch 'master' into examples