Add assertion to prevent negative values