Fix dataType validator to work with undefined values