some small tweaks reported from coverity analysis