Fixed bug in log code that caused some tests to fail.