prune dead variables
fix excess printf arguments