Added logging for debugging.
Fix: Generating timestamp for messages was broken.