Fix/coverity

fixes suggested by Coverity