Fix sign error in entropy calculation