Fixed warnings and analyser issues