Fixes for two Coverity detected issues