fix a couple of warnings
remove dead code and type errors