Fix build and logging