Fix crash on 3.x and 4.0.x devices.