Sample fixes.
Some improvements in AppMain.
iOS version.