Fixes and enhancements to the nagios plugin