Logging, minor bug fixes.