Fix many long to int implicit conversions
21 files changed