Fix copy paste errors in oauth sql query. Add debugging information to failure message.