Misc cleanups: use __attribute__((__unused__)); remove dead code.