Minor fixes and logging statements