When I try to add a consumer, I get the following SQL error:

PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value 'add' to data type int.: SELECT c.[csid] AS [csid], c.[consumer_key] AS [consumer_key], c.[secret] AS [secret], c.[configuration] AS [configuration], pc.[created] AS [created], pc.[changed] AS [changed], pc.[uid] AS [uid], pc.[name] AS [name], pc.[context] AS [context], pc.[callback_url] AS [callback_url] FROM {oauth_common_consumer} c LEFT OUTER JOIN {oauth_common_provider_consumer} pc ON pc.csid = c.csid WHERE ( ([c].[csid] = :db_condition_placeholder_0) ); Array ( [:db_condition_placeholder_0] => add ) in DrupalOAuthConsumer::loadById() (line 173 of \sites\all\modules\oauth\includes\DrupalOAuthConsumer.inc).

PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value 'add' to data type int.: SELECT t.*, pt.[created] AS [created], pt.[changed] AS [changed], pt.[services] AS [services], pt.[authorized] AS [authorized] FROM {oauth_common_token} t INNER JOIN {oauth_common_provider_token} pt ON pt.tid = t.tid WHERE ( ([t].[tid] = :db_condition_placeholder_0) ); Array ( [:db_condition_placeholder_0] => add ) in DrupalOAuthToken::loadById() (line 214 of \sites\all\modules\oauth\includes\DrupalOAuthToken.inc)

Why is a string (in this case, 'add') being used in the condition for an integer field? Are there other parts of the OAuth code where such incorrect queries are also occurring?