Fix and enable logging