Fix Linux compilation, some x64 compat fixes too