Fix variable remapping for Rete collapse;
Clean up debug output a bit;