Fix some warnings, remove some code