Serveral coverity fixes from nagios-plugins