Log improvements. Bug fixes.