Bugfixes

Bugfixes to avoid crashes in appboy