minor fixes and additions for oauth2 support