Type checking for non-negative numbers added.