Fix some scan coverity reports