Fix minor misuses of snprintf