Fix/coverity

- a few fixes from the coverity scans