Weird mixups in native embedded client

These fixes is founded by using fbembed server on x64 OS.
Maybe some fixes should be discussed.
Yes. It's almost fixed in my branch. But it needs some polish. I went through all places where this could occur.