Also add better error checking on input. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>