fix deprecated methods, fix 64-bit conversions