more robust detection of various int types