Fix bug logging