fixed bugs with OAuth

fixed OAuth bugs that @dane-harnett found