OAuth integration and bugfixes