Pull Request for Issue765

- Applied or corrected casts where required to avoid warnings.
- Corrected fun code bits like ```int tempSum1 = 0.0```.  Huh?
- Used ```fabs()``` instead of ```abs()```, as appropriate.
- Changed some ```double```s to ```int```s, and vise versa, where their
declaration did not match with their use.