Monkeyrunner crash fixes

Did some null checks. Apps crash when executing the Android Monkeyrunner. This should be reviewed if the null checks suffice.