pngtools: cleanup comments and fix bugs