Fixed some bugs in logging