Lots of small fixes of issues introduced by the x64 change