Moved logging around.