Fixed validation of integers with ctype_digit