Fixed input validation to exclude zero