Convert remaining sprintf to snprintf