Logging bug fixes