Fix analyser warnings / leaks.