Remove debug code and add in some accidentally removed debug code.