Fix issues found using svace static analyser tool