Wrap more debug statements in conditional checks.
Remove chains and effects by index instead of pointer.