Fixed a logging bug