Adding missing typecasts and guarding i64 __mul with compiler version ch...

Adding missing typecasts and guarding i64 __mul with compiler version check.