Added check to ensure that rule collections are not empty