Change several incorrect length modifiers in format strings

Several places throughout the code used %lu to print a size_t.
This works if size_t is long, but that might not be true e.g. on 32bit.
z is the proper length modifier for size_t.
This should fix a few warnings.
Merge remote-tracking branch 'upstream/master'
Merge pull request #39 from Bike/master

Change some %lu to %zu for standards conformity/32bit warning removal