Up-front logging. Minor changes