fix a few analysis warnings

Fix a few analysis warnings, some nits, and add a tiny bit more exception handling to mobile deploy.

(TBR)