Remove a few compiler warnings recording int precision loss.
Remove precision loss compiler warnings by explicit casting to int.