random: make more consistent use of integer types