Add error checking and meaningful error message if supplied value for --count is invalid.