Fix crashing on API < 17