Clean up defines and revert some debug code.