In get_rules/5: fix calculation of rule costs
Merge branch 'bisect'
Merge remote-tracking branch 'origin/master'