Removing dead code.
Fixing SQL query syntax error.