Fixing multiple issues related to oauth