More cleanups, fixes to logging, removed unused parameter