Fix extension check code to be iOS 6/7 compatible