am fb6dc4fe: Merge "Fix some crashes in the sample" into jb-mr2-dev

* commit 'fb6dc4fedf1034e61a792d24094b7f74854f70d4':
  Fix some crashes in the sample