Sorting was broken due to a miscast of a void pointer.
qsort has an argumen for a comparison function of type
`int (*) (const void*, const void*)`, where the void is the type
of the items in the main array being sorted.
In this case, the array was of type `struct Rule*[]`. The
comparison function was being provided with `struct Rule**`s as
void pointers, which were being cast to `struct Rule*`s and used
like that, causing weird behaviour.
This commit corrects the typecast to cast to `struct Rule**` and
dereferences appropriately.