Changed the pos code to 64-bit clean. Still lots of stuff missing...