Fixed defects from coverity scan