Weird mixups in native embedded client

These fixes is founded by using fbembed server on x64 OS.
Maybe some fixes should be discussed.
Did you had some time to check these changes? I'd like to merge these and close this ticket.