Debug code cleanup