add missing declaration
remove unused variable
fix (s)size_t format strings