Fix crashes on Android ports

Change-Id: I865e8df958b781302618ac2d6165951addcbb1e3