Fixed few coverity issues