Fixed case where bad rules were being parsed and added tests for it