ENG-4290 Fix int cast errors on some compilers.