Merge upstream fixes

Merged upstream bugfixes. Include bug that is currently preventing facebook login.