Fixes for 64bit