Fix RIL crashes, part 1