Fix exceptions when starting Android