Fixed a bad SQL statement.