Datatype fixes to avoid incompatibilities with printing %zu, cleaning up warnings.