replace UINT_MAX with proper numeric limits call