Remove dead code
Fix compile warnings in plugins