Minor cleanups
 - remove redundant conditional
 - remove unused vars
 - remove extra ags to printf
 - reduce scope of decl
Merge pull request #546 from asmaloney/minor_cleanup

Minor cleanups