Some fixes for the TH examples
Very brief introduction to profiling