Fix compatibility; improve logging