minor fixes and logging