Fixes for oauth authentication