Fix oauth linking and tests