[npo] Make extension check less strict and add test (#4680)