Fixed some unused code