Fix check for unsigned int res.