Fixes a bug where `LIMIT` wasn't being added if there were no
sorting criteria.

Also removed some unused options in the SQL sort generator.