Fixed compilation errors on 64-bit platforms (hopefully)