Fixed the rules serializer.