Errors moved to stderr. Where can replace malloc with realloc. uint64_t moved to size_t.