Cleaned up some unused code and debug code.