fix warnings and remove %zu

%zu not officially supported on MSVSC compiler, instead, force a
conversion to unsigned long int and use %lu.