Added tests for extracting rules.