Minor comment changes. Logging functions rewriten.