fix same bug in npmi
add npmi's unit test