Fixes #1 by changing the rand_pos and rand_action functions to use uniform int distribution.