fixes for reported issues by coverity