Remove more unsafe optimizations, handle debug output with reinfectionMode in mind