Improved internal documentation and log messages.