fix NAN for p=0, p=1 in entropy