Fix some unused code