Fix queries for comments list and remove superfluous brackets

The attached commits do three things:
* fix some SQL queries for the statistics page of the comments list in admin CP (add table prefix where it was missing)
* remove superfluous brackets and redundant lines of code
* remove a SQL injection possibility in the download section