Remove some warnings and unused code