fixed bug in feature weight calculation.