Fixed some bugs + Added "rule counting"