Remove debug code
Truncate temporary table at the right time