Warnings--

Fixes some cases where clang complains about loss of integer precision.

Plus fixes call to abs that was considered ambiguous.