Fix some debug logging