Fix validation in codes quantity.

Must validate negative values inputted.