src: Fix debian bug #641381
 * Reported and patch-submitted by Alex Chiang <achiang@caninocal.com>
src: more cleanups
 * delete unused and commented funcs