Fixed a bug in rule scoring