Changes to make OAuth work