Fixed bug in debug logging