Fix all coverity issues