Logging and other small changes