some fixes to compile and logging