Weird mixups in native embedded client

These fixes is founded by using fbembed server on x64 OS.
Maybe some fixes should be discussed.
I've found another similart places. But not sure of fixes, because lack of tests. Will try to add failed tests.