Almost fixed logging