Fixed all the warnings in release 3.10

I've fixed all the warnings, that are present in the 3.10 release. (There were some potential bugs in there)
https://developers.facebook.com/bugs/724535024243347