Index: quotes.module
===================================================================
--- quotes.module	(revision 724)
+++ quotes.module	(working copy)
@@ -1215,7 +1215,7 @@
   $query = 'SELECT n.nid FROM {quotes} q INNER JOIN {node} n ON q.vid=n.vid '
     . quotes_block_join_sql($filters)
     .'WHERE n.status='. (int)($filters['block_type'] != 2)  /* Type=2 is unpublished. */
-    ." AND n.type='quotes' AND "
+    .' AND n.type="quotes" AND '
     . ($promoted_only ? ' q.promote = 1 AND ' : '')
     . quotes_block_where_sql($filters)
     .' ORDER BY '. ($filters['block_type'] == 0 ? 'RAND()' : 'n.created DESC');  /* Type=0 is random. */
@@ -1249,7 +1249,7 @@
   $join = '';
   if ($filters['rid_filter'] && $filters['rid_filter'] != 'none') {
     $a = $aliases['users_roles'];
-    $join .= " LEFT JOIN {users_roles} '. $a USING(uid) ";
+    $join .= ' LEFT JOIN {users_roles} '. $a ." USING(uid) ";
   }
 
   if ($filters['tid_filter'] && $filters['tid_filter'] != 'none') {
@@ -1399,7 +1399,7 @@
     $output = '<div class="quotes-header-bio clear-block">'. check_markup($auth['bio']) .'</div>';
   }
 
-  $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {node} n INNER JOIN {node_revisions} nr USING (vid) INNER JOIN {quotes} q USING (vid) WHERE q.aid='%d' AND n.status=1 AND n.type='quotes' ORDER BY n.sticky DESC, n.created DESC"), $limit, 0, NULL, $aid);
+  $result = pager_query(db_rewrite_sql('SELECT n.nid FROM {node} n INNER JOIN {node_revisions} nr USING (vid) INNER JOIN {quotes} q USING (vid) WHERE q.aid="%d" AND n.status=1 AND n.type="quotes" ORDER BY n.sticky DESC, n.created DESC'), $limit, 0, NULL, $aid);
 
   $output .= '<div class="quotes">';
 
