fixes for a couple of issues identified by coverity