Fixes to debugging topic (and related changes)

Fixes to debugging and optimizing topics. 
Also minor change to index for API reference to fix the rendering of trace.h line