Address some snprintf-related warnings with casts.