fix some warnings and logging