Small fix because previous commit doesn't build due to a typo.
Added performance improvements to logging.
Added more log messages.
Possibly fixed a heisenbug.