improve Ruling.clean_rulings
merge from master