Minor logging improvements.
Refacotored transaction handling.