Add missing closing bracket

The ) character was missing in two places of a SQL query
Clean trailing whitespace