BUGFIX: packed grammar was sorting rules in reverse