bugfix: a NaN quality was always considered best