Minor cleanups

 - remove redundant conditional
 - remove unused vars
 - remove extra ags to printf
 - reduce scope of decl