Fix warnings for msvc, which doesn't support C99's %zu
Don't return uninitialized memory