Weird mixups in native embedded client

These fixes is founded by using fbembed server on x64 OS.
Maybe some fixes should be discussed.
Looks OK for me, see my comment here https://github.com/cincuranet/NETProvider/commit/1b1689ebe8f857d5ffee3ef93b8a9267e0e1dd92
If this is okay, you can merge