Fixed a small bug in logging