Serveral coverity fixes from from nagios-plugins