fix warnings, remove dead code